package cn.hyxy.hadoop;

import java.awt.im.InputContext;
import java.io.IOException;

import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;

public class Demo05_LifeCycleMR extends Configured implements Tool{

	public static void main(String[] args) throws Exception{
		int code=ToolRunner.run(new Demo05_LifeCycleMR(), args);
		System.exit(code);
	}

	@Override
	public int run(String[] arg0) throws Exception {
		
		return 0;
	}
	
	public static class MyMapper extends Mapper<LongWritable, Text, Text, LongWritable>{
		@Override
		protected void setup(Mapper<LongWritable, Text, Text, LongWritable>.Context context)
				throws IOException, InterruptedException {
			InputSplit in=context.getInputSplit();//块
			FileSplit fSplit=(FileSplit) in;
			String name=fSplit.getPath().getName();//获取文件名
		}
		
		
		
		@Override
		protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, LongWritable>.Context context)
				throws IOException, InterruptedException {
			
		}
	}

}
